/*
============================================================================
 Name        : BlockTip.h
 Author      : \x{738b}\x{658c}
 Version     :
 Copyright   : \x{76ca}\x{76df}\x{8f6f}\x{4ef6}
 Description : CBlockTip declaration
============================================================================
*/

#ifndef BLOCKTIP_H
#define BLOCKTIP_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"
// CLASS DECLARATION

/**
*  CBlockTip
* 
*/
class TTipLine
{
public:
	TRgb m_nRGB;
	TBuf<128> m_strTip;

public:
	TTipLine(const TRgb& nRGB, const TDesC& strTip)
	{
		m_nRGB = nRGB;
		m_strTip.Copy(strTip);
	}
};


class CBlockTip : public CBlockGoods
{
public:
	~CBlockTip();

	static CBlockTip* NewL(CBaseBlock* bsBack, const TInt16& sDataType);

	static CBlockTip* NewLC(CBaseBlock* bsBack, const TInt16& sDataType);

	CBlockTip(CBaseBlock* bsBack, const TInt16& sDataType);

private:
	void ConstructL();

public:
	//from CBlock
	void OnDraw(CFbsBitGc& g)const;

	void OnKeyDown(TInt keyCode);

	void OnInput(const TDesC8& strInput);

	TInt32 GetMenuItem();

	void InitData();

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	TInt GetDataLength();

	TInt16 GetDataType();

	void ChangeScrollPos(TInt nPos);

	TBool OnMenuEvent(TInt menuId);
	
	void SizeChanged();
	
protected:
	void AddTabs();

private:
	TInt m_nStart;
	TInt8 m_bDataType;
	RArray<TTipLine> m_vTip;

	TBuf<32> m_bufDownloading;
	TBuf<32> m_bufNoInfo;

};

#endif // BLOCKTIP_H
